package com.dhh.sky.widget;

import java.util.ArrayList;
import java.util.List;
import com.dhh.sky.R;
import com.dhh.sky.util.Constant;
import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

public class TransitionUploadAdapter extends FragmentStatePagerAdapter {
	private String[] tabs;
	private List<TransitionFrame> framents = new ArrayList<TransitionFrame>();

	public TransitionUploadAdapter(FragmentManager fm,Context context) {
		super(fm);
		this.tabs = context.getResources().getStringArray(R.array.transition_tab);
		initFraments();
	}

	@Override
	public Fragment getItem(int position) {
		return framents.get(position);
	}

	@Override
	public int getCount() {
		return tabs.length;
	}
	
	@Override
    public CharSequence getPageTitle(int position) {
    	String title = tabs[position];
        return title;
    }
	
	@Override
    public int getItemPosition(Object object) {
        return POSITION_NONE;
    }
	
	public void initFraments(){
    	framents.clear();
    	framents.add(TransitionFrame.newInstance(Constant.TRANSFER_UPLOAD_COMPLETED));
    	framents.add(TransitionFrame.newInstance(Constant.TRANSFER_UPLOAD_UNCOMPLETED));
    }

}
